﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pomodoro.Core.Model.Domain
{
    public class Task
    {
       
        public int ID{ get; private set; }
        public string Description { get; set; }
        public bool Status { get; private set; }
        public bool Started { get; private set; }
        public DateTime TimeStarted { get; private set; }

        public Task(int id,string description){
            this.ID = id;
            this.Status = false;
            this.Started = false;
            this.Description = description;
        }

        public void Start()
        {
            Started = true;
            TimeStarted = DateTime.Now;
        }

        public void End(){
            Status = true;
        }

        public bool EndOfTaskTime(long timeCurrent) {
            long time = timeCurrent - TimeStarted.Ticks;

            if (TimeSpan.FromTicks(time).TotalMinutes >= 25)
                return true;

            return false;
        }
    }
}
